package com.alcatel_lucent.osp.service;

import com.alcatel_lucent.osp.model.User;
import net.sf.json.JSON;

import java.lang.reflect.InvocationTargetException;
import java.util.Collection;

public interface UserService {
    /**
     * Validate reporter
     * @param cslOrCIL user csl or cil
     * @return user json
     * */
    JSON validateReporter(String cslOrCIL) throws IllegalAccessException, NoSuchMethodException, InvocationTargetException;

    User findUserByCSLorCIL(String cslOrCil);

    Collection<User> findUserByKey(String key);

    JSON searchUsersByKey(String key) throws IllegalAccessException, NoSuchMethodException, InvocationTargetException;

    /**
     *  Get users by their CSLs, save user if it isn't in DB.
     *  @param csls user csl
     *  @return user collection
     * */
    Collection<User> getAndSaveUsersByCSL(String[] csls);

    JSON saveUserByCSL(String csl) throws IllegalAccessException, NoSuchMethodException, InvocationTargetException;

}
